CROSS_COMPILE   :=
CC              := $(CROSS_COMPILE)gcc
CXX             := $(CROSS_COMPILE)g++
LD              := $(CROSS_COMPILE)ld
AR              := $(CROSS_COMPILE)ar
RANLIB          := $(CROSS_COMPILE)ranlib
STRIP           := $(CROSS_COMPILE)strip

IFLAGS  := -Iinc -Iinc/BasicUsageEnvironment -Iinc/groupsock -Iinc/liveMedia -Iinc/UsageEnvironment -I/usr/local/include
CFLAGS  := -m64 -fPIC -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -DBSD=1
LFLAGS  := -Llib -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment -lssl -lcrypto

SRCS    := $(wildcard src/*.cpp)
OBJS    := $(patsubst %.cpp, %.o, $(SRCS))

DIR     = $(shell pwd)
TARGET  = $(notdir $(DIR))

$(TARGET): $(OBJS)
	$(CXX) -o $@ $(OBJS) $(LFLAGS)

%.o:%.cpp
	$(CXX) -c $^ $(IFLAGS) $(CFLAGS) -o $@

clean:
	rm -rf $(OBJS)
	rm -rf $(TARGET)
